import Mock from 'mockjs'
import detail from './data/detail.json'
import detailLikeList from './data/detailLikeList.json'

import tokenData from './data/token.json'
import centerData from './data/center.json'
import homeData from './data/home.json'
import categoryData from './data/category.json'
// 1.请求路径 2.响应

Mock.mock('/mock/getLogin', {
  code: 200,
  data: tokenData,
})
Mock.mock('/mock/getCenterInfo', {
  code: 200,
  data: centerData,
})
Mock.mock('/mock/detail', {
  code: 200,
  data: detail,
})
Mock.mock('/mock/detailLikeList', {
  code: 200,
  data: detailLikeList,
})
Mock.mock('/mock/homeInfo', {
  code: 200,
  data: homeData,
})
Mock.mock('/mock/categoryList', {
  code: 200,
  data: categoryData,
})
// 1.下载mockjs
// 2.目录下面就多了mock文件夹  data(准备一些图表数据)   index.ts(搭建模拟接口)
// 3.下载mockjs的类型声明文件
// 4.为了让这里的代码执行 咱们在main.ts当中进行了引入
// 5.咱们之前发送请求都是用request(发送请求给真实服务器) 又去封装了一个mockRequest(改了基础路径是/mock) 之后发送模拟的请求用它
